﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bosh</title>

    <script type="text/javascript" src="js/libs/jQuery/jquery-1.4.4.dev.js" ></script>

    <script type="text/javascript" src="js/app01.js" ></script>

    <style type="text/css">
        body {background-color:White; color:Aqua;font-family:Tahoma;font-size:9pt;}        
    </style>

    <script type="text/javascript">

        $(document).ready(function () {

            //$('#idSubmit').submit(function () {
            $('#idSubmit').click(function () {

                //Request($('#idUrl').val, $('#idService').val, $('#idMethod').val, $('#idParams').val, null);
                Request();

                return false;
            });
        });

//        function Request(url, service, method, args, data) {
        function Request() {

            var u = $('#idUrl').val();
            var s = $('#idService').val();
            var m = $('#idMethod').val();
            var p = $('#idParams').val();

            $.ajax({
                url : u + '/' + s + '/' + m,
                data : p,
                dataType : 'json',
                cache : false,
                global : false,
                error : handleError,
                success: handleResponse
            });
        };

        function handleResponse(s, xhr, status, data) {
        }

        function handleError(xhr, status, errMsg) {
        }

    </script>
</head>
<body>

    <div>
        <form action="">
            <fieldset><legend>Ajax Input</legend>
                <label>Url:</label><br /><input id="idUrl" type="text" value="http://localhost:13500/ApiHandler.ashx" size="48"/><br />
                <label>Service:</label><br /><input id="idService" type="text" value="SystemState" /><br />
                <label>Method:</label><br /><input id="idMethod" type="text" value="GetRunningApps" /><br />
                <label>Parameters:</label><br /><textarea id="idParams" rows="8" cols="40"></textarea>

                <p>
                <!--input id="idSubmit" type="submit" value="Submit" /-->
                <input id="idSubmit" type="button" value="Submit" />
                <!--input type="reset" value="Clear" /-->
                </p>
            </fieldset>
        </form>
    </div>

</body>
</html>
